Spellbook of protection
| spellbook of + protection | |
|---|---|
| Appearance | random |
| Abundance | 1.8% |
| Base price | 100 zm |
| Weight | 50 |
| Turns to read | 5 |
| Ink to write | 5–9 |
| Spell type | clerical |
| Level | 1 |
| Power cost | 5 Pw |
| Direction | non-directional |
- For the effect granted from this spell, aligned priests and other sources, see protection.
In NetHack, the spellbook of protection can be read to learn the spell of protection. It is a level 1 clerical spell, and the spellbook takes 5 actions to read.
Contents
Generation
Monks have a 1⁄3 chance of starting with a spellbook of protection as their initial spellbook.[1][2] Priests can be given a spellbook of protection as either of the two initial spellbooks in their starting inventory.[3][4][5] Wizards can be given a spellbook of protection as the secondary spellbook in their starting inventory.[6][4]
Spellbooks of protection make up 9⁄500 (1.8%) of all randomly-generated spellbooks. General stores, second-hand bookstores and rare books stores can stock spellbooks of protection.
An aligned priest can be generated with the spellbook of protection as one of their spellbooks.[7]
Writing a spellbook of protection with a magic marker uses up 5 to 9 charges.
The following information pertains to an upcoming version (NetHack 3.7.0). If this version is now released, please verify that the information below is still accurate, then update the page to incorporate it.
Per commit 319dfbda and commit 495a1a9b, Wizards start each game with knowledge of the spellbook of protection's appearance.
Per commit 96787441, pauper Knights, Monk and Priests start with knowledge of the spellbook's appearance.Description
When successfully cast, the spell of protection grants the hero a bonus to AC dependent on their current AC, their experience level and the current level of protection granted specifically from the spell: a hero will gain up to 5 AC from the first round of protection granted by the spell, and will gain progressively less on subsequent castings depending on their current AC and protection level.[8] This protection also raises the hero's magic cancellation to a minimum of MC1, but does not stack with magic cancellation from armor or sources of extrinsic protection such as a worn ring of protection. Protection from the spell wears off at a rate of 1 point every 10 turns, which is slowed to 1 point every 20 turns if the spell was cast at Expert skill.
Details
The exact formula for determining how much protection is granted when casting the spell uses whichever of the following two equations produce a higher result:[8]
or
For these equations, "prior spell AC" is the AC already gained from casting the spell, while "other AC" is 10 minus the hero's AC from every source other than the spell, including all armor bonuses and divine protection, and log2(XL) is just the logarithm with base 2, according to the following table:
| Experience level | log2(XL) |
|---|---|
| 1 | 0 |
| 2-3 | 1 |
| 4-7 | 2 |
| 8-15 | 3 |
| 16-30 | 4 |
The table below shows in detail how much AC casting the protection spell will grant the hero based on their experience level, AC from other sources, and existing AC from the spell:
| XL | Other AC | Total AC from n castings | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ||
| 1 | 10 to 1 | 1 | 2 | 3 | 4 | 4 | 4 | 4 | 4 | 4 |
| 1 | 0 to -9 | 1 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 3 |
| 1 | -10 to -19 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| 1 | <-19 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 2-3 | 10 to 1 | 2 | 4 | 5 | 6 | 7 | 8 | 8 | 8 | 8 |
| 2-3 | 0 to -9 | 2 | 4 | 5 | 6 | 6 | 6 | 6 | 6 | 6 |
| 2-3 | -10 to -19 | 2 | 3 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
| 2-3 | <-19 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| 4-7 | 10 to 1 | 3 | 6 | 8 | 9 | 10 | 11 | 12 | 12 | 12 |
| 4-7 | 0 to -9 | 3 | 5 | 7 | 8 | 9 | 9 | 9 | 9 | 9 |
| 4-7 | -10 to -19 | 3 | 5 | 6 | 6 | 6 | 6 | 6 | 6 | 6 |
| 4-7 | <-19 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 |
| 8-15 | 10 to 1 | 4 | 7 | 10 | 12 | 13 | 14 | 15 | 16 | 16 |
| 8-15 | 0 to -9 | 4 | 7 | 9 | 10 | 11 | 12 | 12 | 12 | 12 |
| 8-15 | -10 to -19 | 4 | 6 | 7 | 8 | 8 | 8 | 8 | 8 | 8 |
| 8-15 | <-19 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
| 16-30 | 10 to 1 | 5 | 9 | 12 | 14 | 16 | 17 | 18 | 19 | 20 |
| 16-30 | 0 to -9 | 5 | 9 | 11 | 13 | 14 | 15 | 15 | 15 | 15 |
| 16-30 | -10 to -19 | 5 | 8 | 9 | 10 | 10 | 10 | 10 | 10 | 10 |
| 16-30 | <-19 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 |
Strategy
The protection spell is a solid utility spell that a hero can cast a few times to stack up on AC on before especially tough fights, e.g. if you are about to engage in a prolonged fight, battle a difficult or out-of-depth monster, take on a group of monsters, or else are generally under-armored for a given encounter. It is also generally useful to try and bolster defenses in the midst of combat situations such as the above, though it may be more ideal to prioritize a means of healing or escape items before trying to shore up your defenses.
Monks that start with the spell can benefit in particular from this to make up for their lack of armor in the early game, whether or not they plan to wear body armor later.
History
The spellbook of protection and its spell are introduced in NetHack 3.3.0. From this version to NetHack 3.4.3, including some variants based on those versions, a bug is present that causes the spell to grant significantly less protection than expected, caused by the "other AC" in the formula above accidentally counting the protection spell AC twice instead of disregarding it—this bug is much more noticeable when casting the spell at high levels. This is fixed in NetHack 3.6.0 via commit bd324483.
Messages
- The <air> around you begins to shimmer with a <golden> haze.
- You cast the protection spell.
- The <golden> haze around you becomes more dense.
- You cast the spell while already protected by it.
- Your skin feels warm for a moment.
- You cast the spell while already at the maximum amount of protection.
- The <golden> haze around you becomes less dense.
- The spell is wearing off.
- The <golden> haze around you disappears.
- The spell has worn off completely.
Variants
Variants of NetHack based on NetHack 3.4.3 and earlier versions may or may not fix the bug that lowers the AC granted by casting the spell of protection.
Some variants make protection into a monster spell available to monsters that can clerical spells.
SLASH'EM
In SLASH'EM, the spell of protection is changed to a level 1 protection spell. Priests and Wizards cannot start with the spellbook due to changes in their starting inventory.[9][10]
This information also applies to SlashTHEM.
GruntHack
In GruntHack, some monsters can use the same set of spells as the hero, including the protection spell.
dNetHack
In dNetHack, notdNetHack and notnotdNetHack, the spell of protection is the Noble's special spell. Drow Healers of both genders can start the game having forgotten the spell of protection.
The spell of protection functions differently than in NetHack 3.4.3, with a more "flat" AC bonus based on the hero's experience level:
| Experience level | AC bonus |
|---|---|
| 1 | 2 |
| 2 to 3 | 4 |
| 4 to 7 | 6 |
| 8 to 15 | 8 |
| 16 to 30 | 10 |
Casting the spell again while the hero already has protection granted from it resets the AC bonus to their current level—if the hero has protection from this spell, and their AC after all other adjustments is no better than 0, their AC is set to 0 before the bonus is applied, e.g. a Wizard with the minimum of 10 AC that casts the spell and gains 2 points of protection will have their AC be set to -2, rather than 8. Casting the spell while it is in effect also resets the duration that it lasts for and how long the protection takes to dissipate, which is based on the hero's skill level at the time of casting:
| Casting skill | 1 point wears off after |
|---|---|
| Expert | 30 turns |
| Skilled | 20 turns |
| Basic | 15 turns |
| Unskilled | 10 turns |
The spell of protection can also be cast continuously via spell maintenance.
While the spell's AC bonuses are applied, the hero's energy regeneration rate has a penalty of 10 + 2x applied where x is the amount of protection granted from the spell. When a hero with AC better than -10 (as opposed to better than 0 like in NetHack) and protection from the spell is attacked, their spell protection is factored out from their AC before any randomization for negative AC is done, then added back onto the value afterward—the Wizard with -2 AC including 2 points from the spell in the previous example above will still have -2 AC for purposes of calculating an opponent's to-hit against them in combat, but if that Wizard instead has -14 AC including those 2 points of spell protection will have their randomized AC be either -13 or -14, rather than any value from -11 to -14.
One of the invoke effects for the Rod of Seven Parts casts the protection spell and summons several high-level vortices and elementals as temporary pets, which uses up 7 points from the artifact's current enchantment and requires a minimum enchantment of +7.
FIQHack
In FIQHack, casting the spell of protection requires that the caster is not wearing body armor.
Monsters can use the same set of spells as the hero, with skill levels to match, and can learn and utilize the protection spell.
The spell of protection can also be cast continuously via spell maintenance, similar to dNetHack and its derivatives.
EvilHack
In EvilHack, monsters can cast the protection monster spell, which grants them bonuses to AC as it does for the hero.
Hack'EM
In Hack'EM, the spell of protection is changed to a level 1 enchantment spell.
Monsters can cast the protection monster spell as in EvilHack.
References
- ↑ src/u_init.c in NetHack 3.6.7, line 88
- ↑ src/u_init.c in NetHack 3.6.7, line 713-L715
- ↑ src/u_init.c in NetHack 3.6.7, line 107
- ↑ 4.0 4.1 src/u_init.c in NetHack 3.6.7, line 1020
- ↑ src/u_init.c in NetHack 3.6.7, line 1050
- ↑ src/u_init.c in NetHack 3.6.7, line 169
- ↑ src/priest.c in NetHack 3.6.7, line 264
- ↑ 8.0 8.1 src/spell.c in NetHack 3.6.7, line 763: cast_protection() function
- ↑ u_init.c in SLASH'EM 0.0.7E7F2, line 1135
- ↑ u_init.c in SLASH'EM 0.0.7E7F2, line 1257
This page is based on a spoiler by Dylan O'Donnell. The original license is:
Redistribution, copying, and editing of these spoilers, with or without modification, are permitted provided that the following conditions are met:
- The original contributors to any spoiler must continue to be credited.
- Any modifications to the spoiler must be acknowledged and credited.

